<?php

namespace App\Http\Controllers\Admin;

use App;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Model\Tag;


class TagController extends Controller
{

    public function index(Request $request)
    {
        return view('admin.tag.index');
    }
    //添加
    public  function create(){
        //分类
        $type_list=tagType::All();
        $tag_list=Tag::All();
        $assign=compact('type_list','tag_list');
        //标签
        return view('admin.tag.add',$assign);
    }
    //添加业务
    public  function store(Request $request){
        $val=$request->input('val');
        $inserArr=[
            'name'=>$val
        ];
        $tag=Tag::create($inserArr);
        $id=$tag->id;
        if(!empty($id)){
            return respone_return('200','获取成功',['id'=>$id]);
        }else{
            return respone_return('0','获取失败',['id'=>$id]);
        }
    }//修改
    public  function edit($id){

    }
    //修改业务
    public  function update($id){
        
    }
    //删除
    public  function del(){

    }


}
